<h1>Listing companies</h1>

<% link_to new_company_path, :class => 'ui-state-default ui-corner-all dialog_link' do %>
	<span class="ui-icon ui-icon-plus"></span>New company
<% end %>

<table>
  <tr class="ui-state-default">
    <th>Name</th>
    <th>Num siret</th>
    <th>Phone num</th>
    <th>Address</th>
    <th colspan="2"></th>
  </tr>

<% @companies.each do |company| %>
  <tr>
    <td><%=h company.name %></td>
    <td><%=h company.num_siret %></td>
    <td><%=h company.phone_num %></td>
    <td><%=h company.address %></td>
    <td>
    	<% link_to company, :class => "ui-state-default ui-corner-all dialog_link" do %>
			<span class="ui-icon ui-icon-search"></span>View
		<% end %>
    </td>
    <td>
    	<% link_to company, :confirm => 'Are you sure ?', :method => :delete, :class => "ui-state-error ui-corner-all dialog_link ui-state-hover" do %>
			<span class="ui-icon ui-icon-close"></span>Destroy
		<% end %>
	</td>
  </tr>
<% end %>
</table>